﻿@model DingTalkAgent.Model.SysPage
@{
    ViewBag.Title = "Add";
    Layout = null;
}


<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title">添加页面</h4>
</div>

<div class="modal-body">
@using (Html.BeginForm(new { id = "form_Add", name = "form_Add" }))
            {
        <table cellspacing="0" cellpadding="0" width="100%" class="table">
            <tr>
                <th>
                    页面代码：
                </th>
                <td>
                    @Html.TextBox("Code", "系统自动生成", new { @readonly = "readonly", style = "color:#ccc" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    页名字：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    上层页面：
                </th>
                <td>
                    @Html.Hidden("Parent_ID", -1)
                    @Html.TextBox("ParentName", "", new { @class = "form-control" })@Html.Hidden("ParentCode")
                    @Html.HiddenFor(model => model.Page_ID)

                    <a href="#" onclick="selectPage()" class="btn btn-outline btn-success">选择</a><a href="#" onclick="ClearPage()" class="btn btn-outline btn-success">..清空..</a>

</td>
            </tr>
            <tr>
                <th>
                    排序编号：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.OrderID, new { @class = "txt" })
                    <div>
                        降序排列，只可以为数字。
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    描述：
                </th>
                <td>
                    @Html.TextAreaFor(model => model.Remark, new { @class = "txt" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    Controller：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Controller, new { @class = "txt" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    Action：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Action, new { @class = "txt" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    是否启用：
                </th>
                <td>
                    @Html.CheckBoxFor(model => model.active)是
                    <div>
                    </div>
                </td>
            </tr>
        </table>
    }
    <div class="remark">
        <h4 class="remark_tit">
            温馨提示
        </h4>
        <div class="remark_content">
            <p>
                <span class="must">*</span>项必须填写。
            </p>
        </div>
    </div>

</div>

<div class="modal-footer">
    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
    <button type="button" class="btn btn-primary" id="Add">保存</button>
</div>


<script type="text/javascript">
    $(document).ready(function () {
        $("#Add").click(function () {
            SetData('/SysBase/SysPAdd', '信息添加成功!');
        });

    });
    function selectPage() {
        layer.open({
            type: 2,
            title: false,
            skin:'layui-layer-lan',
            shadeClose: false,
            shade: 0.3,
            scrollbar: false,
            area: ['1000px', '720px'],
            content: 'SysPList?isPopup=true' //iframe的url
        });        
    }

    function ClearPage() {
        $("#Parent_ID").val(-1);
        $("#ParentName").val("");
    }
    function changeParentPage(_id, _name, _code) {
        $("#Parent_ID").val(_id);
        $("#ParentName").val(_name);
        $("#ParentCode").val(_code);
        layer.close(layer.index);
    }

</script>
